import React from 'react';
import { Descriptions, Card } from 'antd';

const DescriptionCard = ({ dataSource, columnCount, cardTitle }) => {
  const renderDescriptions = () => {
    return dataSource.map((item, index) => (
      <Descriptions.Item
        label={item.label}
        key={index}
        labelStyle={{ fontWeight: 500 }}
        contentStyle={{ fontWeight: 400 }}
      >
        {item.content}
      </Descriptions.Item>
    ));
  };

  return (
    <Card title={cardTitle} bordered={false}>
      <Descriptions column={columnCount}>{renderDescriptions()}</Descriptions>
    </Card>
  );
};
export default DescriptionCard;
